<?php
/**
 * User.php class file.
 * @author wudg <544038230@qq.com>
 * @date 2020/10/21- 10:17 上午
 */

namespace common\components\api\cloud;


class User extends BaseApi
{
    /**
     * @param int $user_id
     * @param string $code
     * @return mixed
     * @throws \GuzzleHttp\Exception\GuzzleException
     * @throws \common\exception\ServicesException
     */
    public function getAuth(int $user_id,string $code='')
    {

        $requestUrl = '/api/shop/get_auth';

        $args = array_merge($this->getToken($user_id),[
            'addto'=>$user_id,
            'code'=>$code,
            'catalog' => 'Apple',
            'platform' => 2,
        ]);

        $resData = $this->requestApi($requestUrl,$args);

        return $resData;

    }


}